package com.wb.service.impl;

import com.github.pagehelper.PageHelper;
import com.wb.mapper.EbNewsMapper;
import com.wb.model.EbNews;
import com.wb.model.EbProduct;
import com.wb.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class NewsServiceImpl implements NewsService {


    @Autowired
    private EbNewsMapper ebNewsMapper;


    @Override
    public List<EbNews> list(int page, int pageSize) {
        PageHelper.startPage(page,pageSize);
        List<EbNews> ebNews =ebNewsMapper.selectByExample(null);
        return ebNews;


    }

    @Override
    public Integer save(EbNews ebNews) {
        return ebNewsMapper.insert(ebNews);
    }


}

